'****************************************************************************'
'                                                                            '
' Copyright (C) 2010 Muhammad alaa                                           '
'                                                                            '
' This program is free software; you can redistribute it and/or modify       '
' it under the terms of the GNU General Public License as published by       '
' the Free Software Foundation; either version 2 of the License, or          '
' (at your option) any later version.                                        '
'                                                                            '
' This program is distributed in the hope that it will be useful,            '
' but WITHOUT ANY WARRANTY; without even the implied warranty of             '
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              '
' GNU General Public License for more details.                               '
'                                                                            '
' You should have received a copy of the GNU General Public License along    '
' with this program; if not, write to the Free Software Foundation, Inc.,    '
' 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.                '
'                                                                            '
'****************************************************************************'

Public Structure AASHELLMENUFILENAME
    Public cbTotal As Short
    <MarshalAs(UnmanagedType.ByValArray, ArraySubType:=UnmanagedType.U1, SizeConst:=12)> _
    Public rgbReserved() As Byte
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public szFileName As String
End Structure

Public Structure AASHELLMENUITEM
    Public lpReserved1 As IntPtr
    Public iReserved As Integer
    Public uiReserved As UInteger
    Public lpName As AASHELLMENUFILENAME
    <MarshalAs(UnmanagedType.LPStr)> _
    Public psz As String
End Structure

Public Structure APPBARDATA
    Public cbSize As Integer
    Public hwnd As IntPtr
    Public uCallbackMessage As UInteger
    Public uEdge As Integer
    Public rc As Rect
    Public lParam As IntPtr
End Structure

Public Structure AppCategoryInfo
    Public Locale As UInteger
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pszDescription As String
    Public AppCategoryId As Guid
End Structure

Public Structure AppCategoryInfoList
    Public cCategory As UInteger
    <MarshalAs(UnmanagedType.LPArray)> _
    Public pCategoryInfo() As AppCategoryInfo
End Structure

Public Structure AppInfoData
    Public cbSize As UInteger
    Public dwMask As UInteger
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pszDisplayName As String
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pszVersion As String
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pszProductID As String
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pszRegisteredOwner As String
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pszRegisteredCompany As String
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pszLanguage As String
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pszSupportUrl As String
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pszLanguage2 As String
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pszSupportTelephone As String
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pszHelpLink As String
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pszInstallLocation As String
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pszInstallSource As String
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pszInstallDate As String
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pszContact As String
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pszComments As String
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pszImage As String
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pszReadmeUrl As String
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pszUpdateInfoUrl As String
End Structure

Public Structure CompPos
    Public dwSize As Integer
    Public iLeft As Integer
    Public iTop As Integer
    Public dwWidth As Integer
    Public dwHeight As Integer
    Public izIndex As Integer

    <MarshalAs(UnmanagedType.Bool)> _
    Public fCanResize As Boolean

    <MarshalAs(UnmanagedType.Bool)> _
    Public fCanResizeX As Boolean

    <MarshalAs(UnmanagedType.Bool)> _
    Public fCanResizeY As Boolean

    Public iPreferredLeftPercent As Integer
    Public iPreferredTopPercent As Integer
End Structure

Public Structure CompStateInfo
    Public dwSize As Integer
    Public iLeft As Integer
    Public iTop As Integer
    Public dwWidth As Integer
    Public dwHeight As Integer
    Public dwItemState As Integer
End Structure

Public Structure Component
    Public dwSize As Integer
    Public dwID As Integer
    Public iComponentType As Integer

    <MarshalAs(UnmanagedType.Bool)> _
    Public fChecked As Boolean

    <MarshalAs(UnmanagedType.Bool)> _
    Public fDirty As Boolean

    <MarshalAs(UnmanagedType.Bool)> _
    Public fNoScroll As Boolean

    Public cpPos As CompPos
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=Constants.MAX_PATH)> _
    Public wszFriendlyName As String

    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=Constants.INTERNET_MAX_URL_LENGTH)> _
    Public wszSource As String

    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=Constants.INTERNET_MAX_URL_LENGTH)> _
    Public wszSubscribedURL() As Char
    Public dwCurItemState As Integer
    Public csiOriginal As CompStateInfo
    Public csiRestored As CompStateInfo
End Structure

Public Structure ComponentsOpt
    Public dwSize As Integer
    <MarshalAs(UnmanagedType.Bool)> _
    Public fEnableComponents As Boolean
    <MarshalAs(UnmanagedType.Bool)> _
    Public fActiveDesktop As Boolean
End Structure

Public Structure WallpaperOpt
    Public dwSize As Integer
    Public dwStyle As Integer
End Structure

Public Structure AssociationElement
    Dim ac As AssocClass
    Dim hkClass As IntPtr
    <MarshalAs(UnmanagedType.LPWStr)> _
    Dim pszClass As String
End Structure

Public Structure BandSiteInfo
    Dim dwMask As UInteger
    Dim dwState As UInteger
    Dim dwStyle As UInteger
End Structure

<StructLayout(LayoutKind.Sequential)> _
Public Structure ShItemID
    Public cb As UShort
    <MarshalAs(UnmanagedType.LPArray, ArraySubType:=UnmanagedType.U1)> Public abID() As Byte
End Structure

Public Structure ItemIdList
    Public mkid As ShItemID
End Structure

<StructLayout(LayoutKind.Sequential)> _
Public Structure ToolbarItem
    Public ptbar As Shell.IDockingWindow
    Public rcBorderTool As Rect
    <MarshalAs(UnmanagedType.LPWStr)> Public pwszItem As String
    <MarshalAs(UnmanagedType.Bool)> Public fShow As Boolean
    Public hMon As IntPtr
End Structure

<StructLayout(LayoutKind.Sequential)> _
Public Structure BaseBrowserData
    Public _hwnd As IntPtr
    <MarshalAs(UnmanagedType.Interface)> Public _ptl As Shell.ITravelLog
    <MarshalAs(UnmanagedType.Interface)> Public _phlf As IE.IHlinkFrame
    <MarshalAs(UnmanagedType.Interface)> Public _pautoWB2 As IE.IWebBrowser2
    <MarshalAs(UnmanagedType.Interface)> Public _pautoEDS As Shell.IExpDispSupport
    <MarshalAs(UnmanagedType.Interface)> Public _pautoSS As Shell.IShellService
    Public _eSecureLockIcon As Integer
    Public _fCreatingViewWindow As UInteger
    Public _uActivateState As UInteger
    Public _pidlNewShellView As ItemIdList
    <MarshalAs(UnmanagedType.Interface)> Public _pctView As OLE.IOleCommandTarget
    Public _pidlCur As ItemIdList
    <MarshalAs(UnmanagedType.Interface)> Public _psv As Shell.IShellView
    <MarshalAs(UnmanagedType.Interface)> Public _psf As Shell.IShellFolder
    Public _hwndView As IntPtr
    <MarshalAs(UnmanagedType.LPWStr)> Public _pszTitleCur As String
    Public _pidlPending As ItemIdList
    <MarshalAs(UnmanagedType.Interface)> Public _psvPending As Shell.IShellView
    <MarshalAs(UnmanagedType.Interface)> Public _psfPending As Shell.IShellFolder
    Public _hwndViewPending As IntPtr
    <MarshalAs(UnmanagedType.LPWStr)> Public _pszTitlePending As String
    <MarshalAs(UnmanagedType.Bool)> Public _fIsViewMSHTML As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public _fPrivacyImpacted As Boolean
    Public _lPhishingFilterStatus As Integer
End Structure

<StructLayout(LayoutKind.Sequential)> _
Public Structure FolderSettings
    Public ViewMode As FolderViewMode
    Public fFlags As FolderFlags
End Structure

<StructLayout(LayoutKind.Sequential)> _
Public Structure FolderSetData
    Public _fs As FolderSettings
    Public _vidRestore As Object
    Public _dwViewPriority As UInteger
End Structure

<StructLayout(LayoutKind.Sequential)> _
Public Structure CreateStrcut
    Public lpCreateParams As Object
    Public hInstance As IntPtr
    Public hMenu As IntPtr
    Public hwndParent As IntPtr
    Public cy As Integer
    Public cx As Integer
    Public y As Integer
    Public x As Integer
    Public style As Integer
    <MarshalAs(UnmanagedType.LPTStr)> Public lpszName As String
    <MarshalAs(UnmanagedType.LPTStr)> Public lpszClass As String
    Public dwExStyle As Integer
End Structure

<StructLayout(LayoutKind.Sequential)> _
Public Structure NMHDR
    Public hwndFrom As IntPtr
    Public idFrom As UIntPtr
    Public code As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> _
Public Structure cmInvokeCommandInfo
    Public cbSize As UInteger
    Public fMask As UInteger
    Public hwnd As IntPtr
    <MarshalAs(UnmanagedType.LPStr)> Public lpVerb As String
    <MarshalAs(UnmanagedType.LPStr)> Public lpParameters As String
    <MarshalAs(UnmanagedType.LPStr)> Public lpDirectory As String
    Public nShow As Integer
    Public dwHotKey As UInteger
    Public hIcon As IntPtr
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> _
Public Structure cmInvokeCommandInfoEx
    Public cbSize As UInteger
    Public fMask As UInteger
    Public hwnd As IntPtr
    <MarshalAs(UnmanagedType.LPStr)> Public lpVerb As String
    <MarshalAs(UnmanagedType.LPStr)> Public lpParameters As String
    <MarshalAs(UnmanagedType.LPStr)> Public lpDirectory As String
    Public nShow As Integer
    Public dwHotKey As UInteger
    Public hIcon As IntPtr
    <MarshalAs(UnmanagedType.LPStr)> Public lpTitle As String

    <MarshalAs(UnmanagedType.LPWStr)> Public lpVerbW As String
    <MarshalAs(UnmanagedType.LPWStr)> Public lpParametersW As String
    <MarshalAs(UnmanagedType.LPWStr)> Public lpDirectoryW As String
    <MarshalAs(UnmanagedType.LPWStr)> Public lpTitleW As String
    Public ptInvoke As Point
End Structure

<StructLayout(LayoutKind.Sequential)> _
Public Structure Category_Info
    Public cif As CategoryInfoFlags
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=Constants.MAX_PATH, ArraySubType:=UnmanagedType.LPWStr)> _
    Public wszName As String
End Structure

<StructLayout(LayoutKind.Sequential)> _
Public Structure ShColumnID
    Public fmtid As Guid
    Public pid As UInteger
End Structure

<StructLayout(LayoutKind.Sequential)> _
Public Structure PropertyKey
    Public fmtid As Guid
    Public pid As UInteger
End Structure

<StructLayout(LayoutKind.Sequential)> _
Public Structure ColumnInfo
    Public cbSize As UInteger
    Public dwMask As UInteger
    Public dwState As UInteger
    Public uWidth As UInteger
    Public uDefaultWidth As UInteger
    Public uIdealWidth As UInteger
    <MarshalAs(UnmanagedType.LPArray, SizeConst:=Constants.MAX_PATH, ArraySubType:=UnmanagedType.LPWStr)> _
    Public wszName As String
End Structure

<StructLayout(LayoutKind.Sequential)> _
Public Structure ShColumnInfo
    Public scid As ShColumnID
    Public vt As UInteger
    Public fmt As UInteger
    Public cChars As UInteger
    Public csFlags As UInteger
    <MarshalAs(UnmanagedType.LPArray, sizeconst:=Constants.MAX_PATH, arraysubtype:=UnmanagedType.LPWStr)> _
    Public wszTitle As String
    <MarshalAs(UnmanagedType.LPArray, sizeconst:=Constants.MAX_PATH, arraysubtype:=UnmanagedType.LPWStr)> _
    Public wszDescription As String
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> _
Public Structure ShColumnData
    Public dwFlags As UInteger
    Public dwFileAttributes As UInteger
    Public dwReserved As UInteger
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pwszExt As String
    <MarshalAs(UnmanagedType.ByValArray, sizeconst:=Constants.MAX_PATH)> _
    Public wszFile As String
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> _
Public Structure ShColumnInit
    Public dwFlags As UInteger
    Public dwReserved As UInteger
    <MarshalAs(UnmanagedType.ByValArray, sizeconst:=Constants.MAX_PATH)> _
    Public wszFile As String
End Structure

<StructLayout(LayoutKind.Sequential)> _
Public Structure CredentialProviderCredentialSerialization
    Public ulAuthenticationPackage As UInteger
    Public clsidCredentialProvider As Guid
    Public cbSerialization As UInteger
    <MarshalAs(UnmanagedType.LPArray)> _
    Public rgbSerialization() As Byte
End Structure

<StructLayout(LayoutKind.Sequential)> _
Public Structure CredentialProviderFieldDescriptor
    Public dwFieldID As UInteger
    Public cpft As CredentialProviderFieldType
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pszLabel As String
    Public guidFieldType As Guid
End Structure

<StructLayout(LayoutKind.Sequential)> _
Public Structure DeskBandInfo
    Public dwMask As UInteger
    Public ptMinSize As Point
    Public ptMaxSize As Point
    Public ptIntegral As Point
    Public ptActual As Point
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public wszTitle As String
    Public dwModeFlags As UInteger
    Public crBkgnd As UInteger
End Structure

<StructLayout(LayoutKind.Sequential)> _
Public Structure ShDragImage
    Public sizeDragImage As Size
    Public ptOffset As Point
    Public hbmpDragImage As IntPtr
    Public crColorKey As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> _
Public Structure ExtraSearch
    Public guidSearch As Guid
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=80)> _
    Public wszFriendlyName As String
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=2084)> _
    Public wszUrl As String
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> _
Public Structure ShellItemResource
    Public guidType As Guid
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=Constants.MAX_PATH)> _
    Public szName As String
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> _
Public Structure SyncHandlerItemInfo
    Public handlerID As Guid
    Public itemID As Guid
    Public hIcon As IntPtr
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=128)> _
    Public wszItemName As String
    Public dwCheckState As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> _
Public Structure ComDlgFilterSpec
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pszName As String
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pszSpec As String
End Structure

<StructLayout(LayoutKind.Sequential)> _
Public Structure WIN32_FIND_DATA
    Public dwFileAttributes As UInteger
    Public ftCreationTime As FileTime
    Public ftLastAccessTime As FileTime
    Public ftLastWriteTime As FileTime
    Public nFileSizeHigh As UInteger
    Public nFileSizeLow As UInteger
    Public dwReserved0 As UInteger
    Public dwReserved1 As UInteger
    <MarshalAs(UnmanagedType.LPWStr, SizeConst:=260)> _
    Public cFileName As String
    <MarshalAs(UnmanagedType.LPWStr, SizeConst:=14)> _
    Public cAlternateFileName As String
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> _
Public Structure FVSHOWINFO
    Public cbSize As UInteger
    Public hwndOwner As IntPtr
    Public iShow As Integer
    Public dwFlags As UInteger
    Public rect As Rect
    <MarshalAs(UnmanagedType.IUnknown)> _
    Public punkRel As Object
    <MarshalAs(UnmanagedType.LPWStr, SizeConst:=260)> _
    Public strNewFile As String
End Structure

<StructLayout(LayoutKind.Sequential)> _
Public Structure SortColumn
    Public propkey As PropertyKey
    Public direction As SortDirection
End Structure